use sqlx::{Pool, Postgres, Error, query_as, Row, Done};
use crate::model::store::{GoodsModel};
use std::fs::read_to_string;
use crate::common::utils::parse_utils::{parse_i64, parse_u64, parse_i32, parse_i128, parse_usize};
use crate::service::model::store::{LoginModel, InfoModel};

pub async fn get_goods(pool: &Pool<Postgres>, _id: &str) -> Result<String, Error> {
    let sql = format!("select * from goods where id={}", _id);
    let result = query_as::<_, GoodsModel>(&sql).fetch_one(pool).await?;

    let json = serde_json::to_string(&result).unwrap();
    Ok(json)
}

pub async fn is_continue_user(pool: &Pool<Postgres>, phone: String) -> Result<i64, Error> {
    let p = parse_i64(phone).unwrap();
    let result = sqlx::query("select count(id) from chat_user where phone=$1 ;")
        .bind(p).fetch_one(pool).await.unwrap();
    let value: i64 = result.get("count");
    Ok(value)
}

pub async fn register_sql(pool: &Pool<Postgres>, phone: String, pwd: String, nick: String, pic: String) -> Result<u64, Error> {
    let sql = format!("INSERT INTO chat_user (phone, pwd, nick, logo,token)
	VALUES ({}, '{}', '{}', '{}','');", phone, pwd, nick, pic);
    let result = sqlx::query(&sql).execute(pool).await?;
    Ok(result.rows_affected())
}

pub async fn login_sql(pool: &Pool<Postgres>, phone: String, pwd: String) -> Result<LoginModel, Error> {
    let sql=format!("select id,phone,nick,logo,token from chat_user where phone={0} and pwd=$1;",phone);
    let result = sqlx::query_as::<_, LoginModel>(&sql).bind(pwd).fetch_one(pool).await?;
    Ok(result)
}

pub async fn set_login_token_sql(pool: &Pool<Postgres>,phone:&str,pwd:&str,token:&str)->Result<u64, Error> {
    let sql=format!("UPDATE chat_user
	SET token='{0}'
	WHERE phone={1} and pwd=$1;",token,phone);
    let result = sqlx::query(&sql).bind(pwd).execute(pool).await?;
    Ok(result.rows_affected())
}

pub async fn get_info(pool:&Pool<Postgres>, id:String)->Result<InfoModel,Error>{
    let sql=format!("select nick,logo,phone from chat_user where id={}",id);

    let result = sqlx::query_as::<_, InfoModel>(&sql) .fetch_one(pool).await?;
    Ok(result)
}


//home json
pub fn get_home() -> String {
    let json = "{
\"status\":200,
\"message\":\"成功\",
\"data\":{
\"banner\":[
\"https://img.hznzcn.com/upload_file/brand/202007/bbb8e4aa-1664-44c1-820c-6c9711e419c5.png\",
\"https://img.hznzcn.com/upload_file/brand/202007/bbb8e4aa-1664-44c1-820c-6c9711e419c5.png\",
\"https://img.hznzcn.com/upload_file/brand/202007/bbb8e4aa-1664-44c1-820c-6c9711e419c5.png\",
\"https://img.hznzcn.com/upload_file/brand/202007/bbb8e4aa-1664-44c1-820c-6c9711e419c5.png\",
\"https://img.hznzcn.com/upload_file/brand/202007/bbb8e4aa-1664-44c1-820c-6c9711e419c5.png\"
],
\"classify\":[
{
\"name\":\"大牌女装\",
\"url\":\"https://img.alicdn.com/tfs/TB1ks6wQ7T2gK0jSZFkXXcIQFXa-440-470.png_640x480q100.jpg\"
},
{
\"name\":\"运动户外会场\",
\"url\":\"https://img.alicdn.com/tfs/TB1dE82gfzO3e4jSZFxXXaP_FXa-440-470.png_640x480q100.jpg\"
},
{
\"name\":\"大牌女装\",
\"url\":\"https://img.alicdn.com/tfs/TB1ks6wQ7T2gK0jSZFkXXcIQFXa-440-470.png_640x480q100.jpg\"
}

],
\"trend\":[\"https://img.alicdn.com/tfs/TB1nEHEQuL2gK0jSZFmXXc7iXXa-476-538.jpg_1080x1800q75s0.jpg\",\"https://img.alicdn.com/tfs/TB1peLsQpT7gK0jSZFpXXaTkpXa-476-538.jpg_1080x1800q75s0.jpg\",\"https://img.alicdn.com/tfs/TB1MKHhQxz1gK0jSZSgXXavwpXa-476-538.jpg_1080x1800q75s0.jpg\"],
\"like\":[
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
},
{
\"title\":\"花花公子男士短袖t恤2020新款渐变男夏季休闲冰丝套装情侣装夏装\",
\"url\":\"https://img.alicdn.com/imgextra/i1/2104737844/O1CN01A6Mn0b27obL6d9yVE_!!2104737844.jpg_430x430q90.jpg\",
\"price\":\"100.00\",
\"shop\":\"灵隐寺分店\"
}
]
}
}";

    json.to_string()
}

//goods json
pub fn get_goods_json() -> String {
    let json = "{
\"status\": 200,
\"msg\": \"success\",
\"data\": {
\"goods_id\": \"2100013452\",
\"shop_id\": \"10224\",
\"name\": \"2021夏季新款男式T恤衫潮牌棉质休闲纯色翻领短袖T恤\",
\"code_num\": \"6021\",
\"pic\": [\"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/OlgZPImIQO0rQyXpX48hvbgVxNHJmZ.jpg\", \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/RBKy00GN8W2zOjyc8WGGDBhjWfx4oj.jpg\", \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/tGkEEL4KZD7rDlaBYJX4P06xKtdHX2.jpg\", \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qR8bVcmqmMtUDwGey4oWzDn5BxZeFm.jpg\", \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/GwEe7ZRUQE6KYaG5PFAD1zHP5IMunS.jpg\", \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/gtOl8lKpG1ucbSNio2no5Pnc4SlhN8.jpg\"],
\"description\": \"\",
\"cid\": \"50000436\",
\"cid_path\": [\"30\", \"50000436\"],
\"cid_name\": \"男装>T恤\",
\"market_price\": \"0.00\",
\"discount_price\": \"0.00\",
\"price\": \"38.00\",
\"prop_format\": [{
\"name_id\": \"13021751\",
\"value_id\": \"cus-vid\",
\"name\": \"货号\",
\"value\": \"6021\"
}, {
\"name_id\": \"20000\",
\"value_id\": \"29534\",
\"name\": \"品牌\",
\"value\": \"其他/other\"
}, {
\"name_id\": \"122216507\",
\"value_id\": \"3226292\",
\"name\": \"厚薄\",
\"value\": \"常规\"
}, {
\"name_id\": \"122216348\",
\"value_id\": \"29445\",
\"name\": \"袖长\",
\"value\": \"短袖\"
}, {
\"name_id\": \"20663\",
\"value_id\": \"3267188\",
\"name\": \"领型\",
\"value\": \"衬衫领\"
}, {
\"name_id\": \"122216586\",
\"value_id\": \"29947\",
\"name\": \"版型\",
\"value\": \"直筒\"
}, {
\"name_id\": \"122216345\",
\"value_id\": \"29457\",
\"name\": \"适用季节\",
\"value\": \"夏季\"
}, {
\"name_id\": \"122216515\",
\"value_id\": \"3224795\",
\"name\": \"适用场景\",
\"value\": \"日常\"
}, {
\"name_id\": \"42722636\",
\"value_id\": \"20213\",
\"name\": \"基础风格\",
\"value\": \"其他\"
}],
\"spec\": [{
\"name\": \"颜色\",
\"prop_name_id\": \"1627207\",
\"list\": [{
\"name\": \"蓝色\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"prop_id\": \"28338\"
}, {
\"name\": \"白色\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"prop_id\": \"28320\"
}, {
\"name\": \"灰色\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"prop_id\": \"28334\"
}, {
\"name\": \"黑色\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"prop_id\": \"28341\"
}, {
\"name\": \"大红\",
\"pic\": \"\",
\"prop_id\": \"cus-vid大红\"
}, {
\"name\": \"上青\",
\"pic\": \"\",
\"prop_id\": \"cus-vid上青\"
}],
\"group_name\": \"\"
}, {
\"name\": \"尺码\",
\"prop_name_id\": \"20509\",
\"list\": [{
\"name\": \"M\",
\"pic\": \"\",
\"prop_id\": \"28315\"
}, {
\"name\": \"L\",
\"pic\": \"\",
\"prop_id\": \"28316\"
}, {
\"name\": \"XL\",
\"pic\": \"\",
\"prop_id\": \"28317\"
}, {
\"name\": \"2XL\",
\"pic\": \"\",
\"prop_id\": \"6145171\"
}, {
\"name\": \"3XL\",
\"pic\": \"\",
\"prop_id\": \"115781\"
}, {
\"name\": \"4XL\",
\"pic\": \"\",
\"prop_id\": \"cus-vid4XL\"
}],
\"group_name\": \"\"
}],
\"spec_pics\": [{
\"prop_id\": \"28338\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\"
}, {
\"prop_id\": \"28320\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\"
}, {
\"prop_id\": \"28334\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\"
}, {
\"prop_id\": \"28341\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\"
}, {
\"prop_id\": \"cus-vid\",
\"pic\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\"
}],
\"prop_ids\": [{
\"prop_id\": \"1627207\",
\"name\": \"颜色\"
}, {
\"prop_id\": \"28338\",
\"name\": \"蓝色\"
}, {
\"prop_id\": \"20509\",
\"name\": \"尺码\"
}, {
\"prop_id\": \"28315\",
\"name\": \"M\"
}, {
\"prop_id\": \"28316\",
\"name\": \"L\"
}, {
\"prop_id\": \"28317\",
\"name\": \"XL\"
}, {
\"prop_id\": \"6145171\",
\"name\": \"2XL\"
}, {
\"prop_id\": \"115781\",
\"name\": \"3XL\"
}, {
\"prop_id\": \"cus-vid4XL\",
\"name\": \"4XL\"
}, {
\"prop_id\": \"28320\",
\"name\": \"白色\"
}, {
\"prop_id\": \"28334\",
\"name\": \"灰色\"
}, {
\"prop_id\": \"28341\",
\"name\": \"黑色\"
}, {
\"prop_id\": \"cus-vid大红\",
\"name\": \"大红\"
}, {
\"prop_id\": \"cus-vid上青\",
\"name\": \"上青\"
}],
\"status\": 1,
\"materials\": [],
\"sku\": [{
\"sku_id\": \"4188638\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188639\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188640\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188641\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188642\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188643\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"蓝色\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/n6oVqknkwseWYUpx9d0KzyVrnkUZ8k.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28338\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"蓝色/4XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188644\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188645\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188646\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188647\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188648\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188649\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"白色\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/rVRfgHZ4sWX6ilr8i1LIbLHwDvgYUP.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28320\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"白色/4XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188650\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188651\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188652\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188653\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188654\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188655\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"灰色\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/JLa0rR8Rm0dJxWvpueQGnrSunVp4jK.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28334\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"灰色/4XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188656\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188657\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188658\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188659\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188660\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188661\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"黑色\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/jsWUSNcq4YRI8P44EZIU5vMoqzJg4t.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"28341\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"黑色/4XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188662\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188663\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188664\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188665\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188666\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188667\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"大红\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/qNmN8F1Kwv9OEH38b8xkt3fFR6E1M9.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid大红\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"大红/4XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188668\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"M\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"28315\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/M\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188669\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"L\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"28316\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/L\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188670\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"28317\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188671\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"2XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"6145171\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/2XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188672\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"3XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"115781\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/3XL\",
\"goods_code\": \"sku商家编码\"
}, {
\"sku_id\": \"4188673\",
\"goods_id\": \"2100013452\",
\"out_sku_id\": \"\",
\"sku_code\": \"\",
\"prop_key\": [\"颜色\", \"尺码\"],
\"prop_val\": [\"上青\", \"4XL\"],
\"prop_img\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/yhome/202105/03/VDmHQUMi5JeEXiLrQnZN7ShNXyj20w.jpg\",
\"price\": \"38.00\",
\"stock_num\": \"100\",
\"created\": \"2021-05-03 20:15:46\",
\"modified\": \"2021-05-03 20:15:46\",
\"prop_id\": [\"cus-vid上青\", \"cus-vid4XL\"],
\"prop_key_id\": [\"1627207\", \"20509\"],
\"spec\": \"上青/4XL\",
\"goods_code\": \"sku商家编码\"
}],
\"created\": \"2021-05-03 20:15:45\",
\"is_collected\": 0,
\"extension\": [{
\"id\": \"download\",
\"name\": \"图片下载\"
}, {
\"id\": \"baidu_cloud\",
\"name\": \"百度云盘\",
\"url\": \"\",
\"code\": \"9527\"
}]
}
}";
    json.to_string()
}

// shop json
pub async fn get_shop() -> String {
    let result = "
  {
	\"status\": 200,
	\"msg\": \"success\",
	\"data\": {
		\"shop_id\": 10224,
		\"shop_name\": \"国际男装城45\",
		\"shop_head\": \"https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/bosutong-img/20210326153812KCmFPQSsRN5n3rdCX7kP.png\",
    \"goods_num\": 6,
    \"main_cat\": \"男装\",
    \"address\": \"\",
    \"shop_address\": \"国际男装城45\",
    \"signage\": \"45\",
    \"intro\": \"\",
    \"is_collected\": 0,
    \"market_name\": \"国际男装城\",
    \"is_normal\": 0,
    \"contact\": {
        \"phone\": [\"\"],
        \"qq\": [\"\"],
        \"wx\": [\"\"],
        \"ww\": [\"\"]
    }
}
}
";

    result.to_string()
}